<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<h:head>
		<title>Massai - Portal da Produtividade</title>
		<link href="#{facesContext.externalContext.requestContextPath}/styles/stylesheets.css" rel="stylesheet" type="text/css" />
		<link href="#{facesContext.externalContext.requestContextPath}/images/favicon.png" rel="icon" type="image/png" />
		<script src="#{facesContext.externalContext.requestContextPath}/javascripts/mask.js" type="text/javascript" ></script>
	</h:head>

	<h:body>
		<f:view>
			<p:ajaxStatus onstart="PF('statusDialog').show()" onsuccess="PF('statusDialog').hide()" />
			<p:dialog widgetVar="statusDialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false">
				<h:panelGrid cellpadding="5">
					<h:graphicImage value="/images/ajaxloader.gif" style="margin-left: 10px;" />
					<h:outputText value="#{msgs['massai.template.statusLoader']}" style="font-size: 12px;" />
				</h:panelGrid>
			</p:dialog>
			
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<!-- HEADER DA LOGO -->
			<tr>
				<td>
					<table width="100%" border="0" cellpadding="0" cellspacing="0" class="topo">
						<tr>
							<td height="70" width="380">
								<img src="#{facesContext.externalContext.requestContextPath}/images/logo_massai.png" alt="Massai - Construções e Incorporações" />
							</td>
							<td height="70">
								<table width="100%" border="0" cellpadding="0" cellspacing="5">
									<tr align="right">
										<h:form acceptcharset="ISO-8859-1">
											<td>
												<h:panelGroup rendered="#{sessionBean.loggedIn()}">
													<a  style="text-decoration: none;" href="#{facesContext.externalContext.requestContextPath}/pages/home.xhtml">
														<img src="#{facesContext.externalContext.requestContextPath}/images/ico_home.png" 
															width="19" height="19" border="0" alt="#{msgs['massai.template.begin']}"
															name="#{msgs['massai.template.begin']}" title="#{msgs['massai.template.begin']}" />
													</a>

													<a  style="text-decoration: none;" href="#{facesContext.externalContext.requestContextPath}/pages/user/passwordChange.xhtml">
														<img src="#{facesContext.externalContext.requestContextPath}/images/ico_key.png" 
															width="19" height="19" border="0" alt="#{msgs['massai.template.changePassword']}"
															name="#{msgs['massai.template.changePassword']}" title="#{msgs['massai.template.changePassword']}" />
													</a>

													<h:commandLink actionListener="#{sessionBean.logout()}" >
														<img src="#{facesContext.externalContext.requestContextPath}/images/ico_logout.png" 
															width="19" height="19" border="0" name="#{msgs['massai.template.logout']}" 
															alt="#{msgs['massai.template.logout']}" title="#{msgs['massai.template.logout']}" />
													</h:commandLink>
												</h:panelGroup>
											</td>
										</h:form>
									</tr>
									<tr>
										<td align="right">
											<h:panelGroup rendered="#{sessionBean.loggedIn()}">
												<h:outputText value="#{msgs['massai.template.welcome']}" style="font-size: 11px;" />
												<h:outputText value="#{sessionBean.collaboratorName}" style="font-weight:bold; font-size:11px; text-transform: uppercase;" />
											</h:panelGroup>
										</td>
									</tr>
									<tr>
										<td align="right">
											<h:panelGroup rendered="#{sessionBean.loggedIn()}">
												<h:outputText value="#{msgs['massai.template.lastAccess']}" style="font-size: 11px;" />
												<h:outputText value=" #{sessionBean.dateLastAccess()} | #{msgs['massai.template.ip']} #{sessionBean.ipLastAccess()}" 
													style="font-weight:bold; font-size:11px;" />
											</h:panelGroup>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>

			<!-- TOOLBAR DO MENU -->
			<tr>
				<td height="45" background="#{facesContext.externalContext.requestContextPath}/images/background_topo.jpg">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td>
								<h:panelGroup rendered="#{sessionBean.loggedIn()}">
									<ui:include src="/layouts/menu.xhtml" />
								</h:panelGroup>
							</td>
						</tr>
					</table>
				</td>
			</tr>

			<!-- BODY DAS PAGINAS -->
			<tr>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td valign="top">
								<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
									<tr>
										<td>
											<p:messages autoUpdate="true" closable="true" />
										 </td>
									</tr>
									<tr>
										<td height="420" valign="top">
											<div class="corpo">
												<ui:insert name="body" />
											</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>

			<!-- FOOTER -->
			<tr>
				<td class="rodape"><h:outputText value="#{msgs['massai.template.copyright']}" /></td>
			</tr>
		</table>
			
		</f:view>
	</h:body>
</html>